Skip to content

Allow acceptable long lines to suppress warnings - #1872

Merged
jskeet merged 2 commits into
dotnet:draft-v8from
jskeet:issue-1858
Nov 27, 2026
Merged

jskeet merged 2 commits into
dotnet:draft-v8from
jskeet:issue-1858

Conversation

@jskeet

@jskeet jskeet commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

This is hard-coded rather than configurable simply because we don't actually need flexibility here (any one branch will only have a single file) and it's easier than passing a list around, having a new file etc.

There are two new line-length warnings around stackalloc, which I assume are for recently-merged changes; I'll look at those separately.

Fixes #1858

@jskeet
jskeet requested a review from BillWagner November 17, 2026 18:17
@jskeet

jskeet commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

@BillWagner I'll readily admit this is pretty hacky - but in the context of how often we'd want to change things, I think it's reasonable. If we want to extract this bit of config, I'd probably want to do a proper job and extract everything that is currently hard-coded into a JSON file, just to be consistent.

@jskeet

jskeet commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

I don't think the test failures here are due to my changes. @BillWagner is this something you're aware of? (I'm on a train with bad wifi at the moment, so it's slightly tricky to diagnose efficiently.)

@jskeet

jskeet commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

I was wrong about new warnings - copy/paste error. Fixing now; should be warning free afterwards.

@BillWagner BillWagner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had one optional comment. This is good to merge.

{
// expressions.md and grammar.md
// These genuinely wrap, but that's better than breaking the lines.
" : null_conditional_member_access null_forgiving_operator? '(' argument_list? ')'",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing I might consider here is adding a comment stating which clause (in expressions.md) that these productions appear.

I agree this feels like a hack in some ways, but I like the design in that if we edit those lines, suddenly warnings appear and we need to look to see if the new content works. The only stale risk is if we shorten these lines and they remain forever as unneeded accepted long lines.

Noting where they are in the standard might entice us to remove those no longer needed while editing any that changed. (We're just detailed enough to consider it).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have added more detail for the location in a separate commit - not just the number, but the title, so it's easier to find if we renumber.

I did wonder about checking at the end of the conversion whether every long line listed for the file that's being converted ended up being used... but it felt like overengineering in the end. Can explore that if you'd like.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that's more than we need. Let's :shipit:

@jskeet

jskeet commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

@BillWagner: Can't :shipit: yet - the tests are failing. It's failing for me locally as well, and I can only imagine it's unrelated to this PR - will investigate in a separate branch. Error:

ClauseLoadingFailuresWriteReportsWithoutRenumbering("missing",True) (300ms): Error Message: System.IO.DirectoryNotFoundException : Could not find a part of the path 'C:\Users\skeet\AppData\Local\Temp\StandardAnchorTagsReportTests-eq1ccdif.4ym\reports\anchors.json'

This is hard-coded rather than configurable simply because we don't actually need flexibility here (any one branch will only have a single file) and it's easier than passing a list around, having a new file etc.

Fixes dotnet#1858
@jskeet
jskeet merged commit c81a425 into dotnet:draft-v8 Nov 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Find a way to allow-list long lines

2 participants